package com.ruoyi.project.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.base.Field;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@ApiModel("项目核算表")
@TableName(value = "project_accounting",autoResultMap = true)
public class ProjectAccounting extends Field implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 表id */
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty("阶段编码")
    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /** 项目id */
    private String projectNo;

    /** 类型 */
    @Excel(name = "类型")
    private String type;

    /** 类型名称 */
    @Excel(name = "类型名称")
    private String typeName;

    /** 此类型的结算总额 */
    @Excel(name = "此类型的结算总额")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal projectAmount;

    /** 此类型的结算总额 */
    @Excel(name = "项目税额")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal taxAmount;


    /** 项目材料成本 */
    @Excel(name = "项目材料成本")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal materialCost;

    /** 其他成本一 */
    @Excel(name = "其他成本一")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal costOne;

    /** 其他成本二 */
    @Excel(name = "其他成本二")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal costTwo;



    /** 其他成本三 */
    @Excel(name = "其他成本三")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal costThree;

    /** 资金成本 */
    @Excel(name = "资金成本")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal fundCost;

    /** 资金占用金额 */
    @Excel(name = "资金占用金额")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal useAmount;

    /** 月利率 */
    @Excel(name = "月利率")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal monthRate;

    /** 人工成本 */
    @Excel(name = "人工成本")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal laborCost;

    /** 质保金 */
    @Excel(name = "质保金")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal retentionMoney;

    /** 税率 */
    @Excel(name = "税率")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal rate;

    /** 毛利润 */
    @Excel(name = "毛利润")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal profit;

    /** 成本税费 */
    @Excel(name = "成本税费")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal costFees;

    /** 差额税费 */
    @Excel(name = "差额税费")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal differenceFees;

    /** 税前利润 */
    @Excel(name = "税前利润")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal beforeProfit;

    /** 纯利润扣税金 */
    @Excel(name = "纯利润扣税金")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal afterProfit;

    /** 项目提成 */
    @Excel(name = "项目提成")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal projectCommission;

    @Excel(name = "项目提成")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal commissionWarranty;

    /** 操作员 */
    @Excel(name = "操作员")
    private String operator;
    //资金使用时间(月)
    private Double costTime;

    //关联的阶段
    private Long phaseId;

    //关联的阶段
    private String phaseName;

    //1未提交 2已提交 3已撤回 4总经理已确认 针对销售负责人的
    //审核人  关联配置表  从配置表获取需要哪些岗位的人审核postId（审核的岗位）和审核类型needPerson 是否必须全部审核人同意
    private String audit;

    private String remark;

    @TableField(exist = false)
    private String rowStatus;


    /** 往来客户ID */
    private String customerId;

    /** 往来客户对应的主键 */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long mainId;


    //是否是往来客户的利润计算
    @TableField(exist = false)
    private String isCustomer;


}
